#ifndef DOPPLERRULERBAR_H
#define DOPPLERRULERBAR_H

#include <QWidget>


#define DOPPLER_RULER_WIDTH    20

class DopplerRulerBar : public QWidget
{
public:
    enum RULER_BAR_TYPE
    {
        RULER_BAR_LEFT  = 0,
        RULER_BAR_RIGHT    ,
        RULER_BAR_BOTTOM   ,
        RULER_BAR_TOP      ,
        RULER_BAR_MAX
    };

    Q_OBJECT
public:
    explicit DopplerRulerBar(QWidget *parent = 0 , RULER_BAR_TYPE eType_ = RULER_BAR_LEFT);
    void   SetBackgroudColor(QColor* cColor_);
    void   SetMarkerColor(QColor* cColor_)   ;
    void   SetMarkerRange(double nStart_ , double nStop_);
    void   SetMarkerUnit(QString* strUnit_) ;
protected:
    void   paintEvent(QPaintEvent *) ;
    void   drawLeftRuler(QPainter& painter);
    void   drawRightRuler(QPainter& painter);
    void   drawBottomRuler(QPainter& painter);
    int    getRulerMarkQty(int nLength_) ;
    double getRulerMarInterval(int nMarkQty_ , double nRange_) ;

    //void dragEnterEvent(QDragEnterEvent *)  ;
    //void dragLeaveEvent(QDragLeaveEvent *)  ;
    //void dropEvent(QDropEvent *)  ;
protected:
    RULER_BAR_TYPE m_eType ;
    QColor         m_cBgColor ;
    QColor         m_cFgColor ;


    double         m_nStart  ;
    double         m_nEnd    ;
    QString        m_strUnit ;

signals:

public slots:

};

#endif // DPLRULERBAR_H
